<?php

namespace App\Validate;

use App\Validate\BaseValidate;


/**
 * 发送短信验证码
 */
class SendNoteCodeValidate extends BaseValidate
{
    protected  $rule = [
        'id' => 'required|integer',
        'tel' => 'required|size:11|check_tel',
        "key" => "required|size:32|check_tel_key",
        "state" => "required|in:1,2",
        "verify" => 'required|size:6|check_tel_verify'
    ];

    //自定义验证信息
    protected $message = [
        'id.required' => '办证ID不能为空',
        'id.integer' => '办证ID规则不正确',

        'tel.required' => '电话号码不能为空',
        'tel.size' => '电话号码位数不正确',
        'tel.check_tel' => '电话号码规则不正确',

        'key.required' => 'key不能为空',
        'key.size' => 'key规则不正确',
        'key.check_tel_key' => 'key输入不正确',


        'state.required' => '短信发送方式不能为空',
        'state.in' => '短信发送方式规则不正确',

        'verify.required' => '手机验证码不能为空',
        'verify.size' => '手机验证码位数不正确',
        'verify.check_tel_verify' => '手机验证码输入错误',
    ];




    protected  $scene = [
        "send" => ["tel", 'key', 'state'], //发送验证码 前台+后台

    ];
}
